package com.gensdai.leliang.adapter;


import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.facebook.drawee.view.SimpleDraweeView;
import com.gensdai.leliang.R;
import com.gensdai.leliang.utils.ViewHolder;

public class BrandContentListAdapter extends KimiraAdapter<String> {

    LayoutInflater inflater;
    Context context;

    public BrandContentListAdapter(Context context) {
        inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        this.context = context;
    }

    @Override
    public View extralView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.item_content_brand,
                    null);
        }

        SimpleDraweeView icon = ViewHolder.GetChars(convertView, R.id.icon);


		Uri uri = null;

		switch (position) {
		case 0:
			uri = Uri.parse("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496381624730&di=51c52a6a1744a3c09a5a12500b2217c3&imgtype=0&src=http%3A%2F%2Fs16.sinaimg.cn%2Fmw690%2F004b3YQqzy6QFnaaiUDaf%26690");
			break;
		case 1:
			uri = Uri.parse("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496381624727&di=cccbbe7a196679540748866e5a72e533&imgtype=0&src=http%3A%2F%2Fimgqn.koudaitong.com%2Fupload_files%2F2015%2F03%2F19%2FFqLTfzdBuX8ITBcNmT-1HR1Xjtko.png");
			break;
		case 2:
			uri = Uri.parse("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496381624726&di=eeb73f061e8dca11361f61474fc3b5e9&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01e5355715ebf66ac7251343496386.png");
			break;
		case 3:
			uri = Uri.parse("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496381624723&di=35e78126b4b90c7a946422af71de0a05&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F016075577dc8b10000012e7e277ec7.jpg%40900w_1l_2o_100sh.jpg");
			break;
		default:
            uri = Uri.parse("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1496381624723&di=be24e957f957509c860af449ce4a2aa3&imgtype=0&src=http%3A%2F%2Fimg03.weidiancdn.com%2Fimg%2FA%2FYMXXXX5861353-22908_YM0000.png");
			break;
		}
		icon.setImageURI(uri);

//        icon.setBackgroundResource(R.color.image_placebg_color);

        return convertView;
    }

}
